<div class="bjui-pageHeader">
  <form id="pagerForm" data-toggle="ajaxsearch" action="{:U('waitScanOrder')}" method="post">
    <input type="hidden" name="is_apple_cancle" value="{:I('is_apple_cancle')}">
    <div class="bjui-searchBar">
      <div class="bjui-searchBar">
        <label>搜索：</label>
        <div role="group" class="btn-group">
          <select name="key" data-toggle="selectpicker">
            <option value="order_sn" <?php echo I("key")=="order_sn" ? "selected='true'" : "";?>>－网店订单号－</option>
            <option value="order_no" <?php echo I("key")=="order_no" ? "selected='true'" : "";?>>－商品货号－</option>
            <option value="user_name" <?php echo I("key")=="user_name" ? "selected='true'" : "";?>>－姓名－</option>
			<option value="mobile_phone" <?php echo I("key")=="mobile_phone" ? "selected='true'" : "";?>>－手机－</option>
            <option value="home_phone" <?php echo I("key")=="home_phone" ? "selected='true'" : "";?>>－电话－</option>
			<option value="address" <?php echo I("key")=="address" ? "selected='true'" : "";?>>－地址－</option>
            <option value="courie_number" <?php echo I("key")=="courie_number" ? "selected='true'" : "";?>>－快递单号－</option>
			<option value="host_order_sn" <?php echo I("key")=="host_order_sn" ? "selected='true'" : "";?>>－申请编号－</option>
          </select>
          <input type="text" name="value" class="form-control" size="20" value="{:I('value')}">
        </div>
		<div role="group" class="btn-group">
          <select name="express_id" data-toggle="selectpicker">
            <option value="">－选择快递－</option>
            <?php foreach($expressList as $express):?>
            <option value="{$express.id}" <?php echo I("express_id")==$express['id'] ? "selected='true'" : "";?>>{$express.name}</option>
            <?php endforeach;?>
          </select>
        </div>
        <div role="group" class="btn-group">
          <select name="invoice" data-toggle="selectpicker">
            <option value="">－是否开具发票－</option>
            <option value="1" <?php echo I("invoice")=="1" ? "selected='true'" : "";?>>－否－</option>
            <option value="2" <?php echo I("invoice")=="2" ? "selected='true'" : "";?>>－是－</option>
          </select>
        </div>
		<input type="checkbox" name="message_notes" id="j_custom_room" data-toggle="icheck" value="true" data-label="有卖家备注或买家留言" >
         <a class="btn btn-default" onclick="$(this).navtab('reloadForm', false, {data:{is_apple_cancle:0}})" data-icon="search">查询</a>
          
        <div class="pull-right">
        <div class="btn-group">
          <button type="button" class="btn-default dropdown-toggle" data-toggle="dropdown" data-icon="copy">批量生成出库单<span class="caret"></span></button>
          <ul class="dropdown-menu right" role="menu">
		  	<li><a href="{:U('openOutbound')}" data-toggle="doajaxchecked" data-confirm-msg="你确定要批量开启吗？" data-idname="orderIds" data-group="ids">批量开启</a></li>
			<li><a href="{:U('pauseOutbound')}" data-toggle="doajaxchecked" data-confirm-msg="你确定要批量暂停吗？" data-idname="orderIds" data-group="ids">批量暂停</a></li>
			<li><a href="{:U('confirmOutbound')}" data-toggle="doajaxchecked" data-confirm-msg="你确定要批量出库吗？" data-idname="orderIds" data-group="ids">批量出库</a></li>
          </ul>
        </div>
      </div>
      </div>
    </div>
	<div style="margin-bottom: 10px;"> 
	提示：<a href="javascript:;" onclick="$(this).navtab('reloadForm', false, {data:{is_apple_cancle:1}})">当前有 <b>
		  <font color="red">
  		  	<label id="lblFxsAppCancelCount">{$cancelOrder}</label>
  		  </font></b> <span id="lblFxsAppCancel">个订单，分销商申请取消。</span>
		  </a>
    </div>
  </form>
</div>
<div class="bjui-pageContent tableContent">
  <table class="table table-bordered table-hover table-striped table-top">
    <thead>
      <tr>
        <!-- 选择   订单号    网店单号    商品数量  订单状态   提交时间      操作  -->
        <th width="26"><input type="checkbox" class="checkboxCtrl" data-group="ids" data-toggle="icheck" ></th>
        <th data-order-field="order_no" align="center">出库单号</th>
        <th data-order-field="order_sn" align="center">系统订单号<br />网店单号</th>
        <th data-order-field="goods_number" align="center">商品金额<br/>商品数量</th>
        <th data-order-field="express_id" align="center">出库单状态</th>
		<th data-order-field="order_status" align="center">快递名称</th>
        <th data-order-field="status_time" align="center">生成时间</th>
        <th align="center">操作</th>
      </tr>
    </thead>
    <tbody>
      <?php foreach($list as $arr):?>
      <tr>
        <td><input type="checkbox" name="ids" data-toggle="icheck" value="{$arr.order_id}" <if condition="$arr.apple_cancel eq APPLE_CANCEL_YES ">disabled="true" </if>></td>
        <!-- 订单号 -->
        <td align="center"><a  data-toggle="navtab" data-options="{id:'Order{$arr['order_id']}', url:'{:U('ShippingManage/detailsShipping?orderId='.$arr['order_id'].'&navTabId=Order'.$arr['order_id'])}',title:'{$arr.order_sn}-订单详细'}">{$arr.outbound_sn}</a><br/>({$arr.user_name})</td>
        <!-- 网店单号 -->
        <td align="center"><a  data-toggle="navtab" data-options="{id:'Order{$arr['order_id']}', url:'{:U('order/detailsOrder?orderId='.$arr['order_id'].'&isPrinter=1'.'&navTabId=Order'.$arr['order_id'])}', title:'{$arr.order_sn}-订单详细'}">{$arr.order_no}</a>
		<if condition="$arr.message_content neq ''">
		<span class="fa fa-flag" style="color:#FF0000"></span>
		</if>
		<br/><a  data-toggle="navtab" data-options="{id:'Order{$arr['order_id']}', url:'{:U('order/detailsOrder?orderId='.$arr['order_id'].'&navTabId=Order'.$arr['order_id'])}', reloadWarn:'已打开业务页面，确认将重新载入?', title:'{$arr.order_sn}-订单详细'}">{$arr.order_sn}</a></td>
        <!-- 商品数量 -->
        <td align="center">{$arr.order_amount}<br/>{$arr.order_goods_num}</td>
        <!-- 订单状态 -->
        <td align="center">
			<if condition="($arr.status eq BINNING_SEND_OUT)"> 等待出库
 			<else />暂停出库
 			</if>
			<if condition="$arr.is_barter eq '1'">
				<br />（换货订单）
			</if>
		</td>
		<!-- 快递名称 -->
        <td align="center">{$arr.express_name}</td>
        <!-- 提交时间 -->
        <td align="center">{:date('Y-m-d H:i:s', $arr['status_time'])}</td>
        <!-- 操作 -->
        <td>
			<if condition="($arr.status eq BINNING_SEND_OUT)">
                <a href="{:U('pauseOutbound?orderIds='.$arr['order_id'])}" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定取消出库这条订单吗？">暂停出库</a>
                <a href="{:U('confirmOutbound?orderIds='.$arr['order_id'].'&single=1')}"  class="btn btn-green" data-toggle="doajax" data-confirm-msg="确定出库这条订单吗？">确认出库</a>
			<else />
			<a href="{:U('openOutbound?orderIds='.$arr['order_id'])}" class="btn btn-green" data-toggle="doajax" data-confirm-msg="确定开启出库这条订单吗？">开启出库</a> 
			</if>
		</td>
      </tr>
      <?php endforeach;?>
    </tbody>
  </table>
</div>
<div class="bjui-pageFooter">
  <div class="pages"> <span>每页&nbsp;</span>
    <div class="selectPagesize">
      <select data-toggle="selectpicker" data-toggle-change="changepagesize">
        <option value="{$pageSize}">{$pageSize}</option>
        <option value="{$pageSize*3}">{$pageSize*3}</option>
        <option value="{$pageSize*6}">{$pageSize*6}</option>
        <option value="{$pageSize*12}">{$pageSize*12}</option>
        <option value="{$pageSize*15}">{$pageSize*15}</option>
      </select>
    </div>
    <span>&nbsp;条，共 {$total} 条</span> </div>
  <div class="pagination-box" data-toggle="pagination" data-total="{$total}" data-page-size="{$pageSize}"
         data-page-current="{$pageCurrent}"></div>
</div>
